//
//  APMeHeaderView.m
//  AqualPolo
//
//  Created by dong on 2024/5/7.
//

#import "APMeHeaderView.h"

@implementation APMeHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _coinControl = [[APCoinControl alloc] init];
        [self addSubview:_coinControl];
        [_coinControl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(20);
            make.height.mas_equalTo(32);
        }];
        
        _settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_settingButton setBackgroundImage:[UIImage imageNamed:@"setting"] forState:UIControlStateNormal];
        [self addSubview:_settingButton];
        [_settingButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-20);
            make.centerY.equalTo(self);
            make.size.mas_equalTo(CGSizeMake(28, 28));
        }];
        
        _editButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_editButton setBackgroundImage:[UIImage imageNamed:@"me_edit_icon"] forState:UIControlStateNormal];
        [self addSubview:_editButton];
        [_editButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(_settingButton.mas_left).offset(-35);
            make.centerY.equalTo(self);
            make.size.mas_equalTo(CGSizeMake(28, 28));
        }];
        
    }
    return self;
}

@end
